<?php

date_default_timezone_set('PRC');

$basename = $http_scheme.$_SERVER['HTTP_HOST'];

$config = array(
	'rewrite' => array(
		'admin/index.html' => 'admin/main/index',
		'admin/<c>_<a>.html'    => 'admin/<c>/<a>', 
        	'<m>/<c>/<a>'          => '<m>/<c>/<a>',
		'<c>/<a>'          => '<c>/<a>',
		'/'                => 'main/index',
	),
    'view'=>[
        //模板编译目录
        'compile_dir'=> APP_DIR.'/data/runtime/temp',
        'template_dir'=>'',
        //模板标签边界符
        'left_delimiter'=>'{',
        'right_delimiter'=>'}',
        // 模板后缀
        'view_suffix'  => 'html',
        //模板中 特定标签替换
        'view_replace_str' => [
            '__ROOT__'   => $basename,
            '__DATA__'   => $basename . '/data',
            '__PUBLIC__' => $basename . '/public',
            '__UPLOAD__'=> 	$basename . '/data/upload',
        ],
    ],
    'sp_cache'=>APP_DIR.'/data/cache',
);

$domain = array(
	"localhost" => array( // 调试配置
		'debug' => 1,
		'mysql' => array(
				'MYSQL_HOST' =>'127.0.0.1',
				'MYSQL_PORT' =>'3306',
                'MYSQL_DB' =>'speed',
                'MYSQL_USER' =>'root',
				'MYSQL_PASS' =>'root',
				'MYSQL_CHARSET' => 'utf8',
                'MYSQL_PREFIX' =>'sp_',
		),
	),

);
// 为了避免开始使用时会不正确配置域名导致程序错误，加入判断
//if(empty($domain[$_SERVER["HTTP_HOST"]])) die("配置域名不正确，请确认".$_SERVER["HTTP_HOST"]."的配置是否存在！");

return $domain['localhost'] + $config;
//return $domain[$_SERVER["HTTP_HOST"]] + $config;
